import { ResourceInfo } from "./ResourceInfo";
import { Log } from "../../debug/Log";
//class ImageInfo
    
    export  class ImageInfo extends ResourceInfo
    {
        constructor(arg1: Object=null)
        {
            super(arg1);
            return;
        }

        public get bitmapData(): Object /* flash.display.BitmapData */
        {
            return this._bitmapData;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            loaderInfo = arg1 as Object /* flash.display.LoaderInfo */;
            if (loaderInfo) 
            {
                this._bitmapData = flash.display.Bitmap(loaderInfo.content).bitmapData as Object /* flash.display.BitmapData */;
            }
            return;
        }

        public /* override */ dispose(): void
        {
            isLoaded = false;
            isLoading = false;
            super.dispose();
            return;
        }

        protected /* override */ unload(arg1: Object /* flash.display.LoaderInfo */): void
        {
            Log.system("unloadedImage:" + path);
            if (this._bitmapData) 
            {
                this._bitmapData.dispose();
                this._bitmapData = null;
            }
            super.unload(arg1);
            return;
        }

        private /* var */_bitmapData: Object /* flash.display.BitmapData */;
    }
